import com.bigmodel.baidu.Chatglm2;
import com.bigmodel.util.FtlUtil;
import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

public class ChatglmIfElse {

    private final static String FREEMARKER_BASE_PATH = "autotask/v2/ifelse_test/";

    @Test
    public void test1(){
        Map<String,Object> map = new HashMap<>();
        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH+"/ifelse1.ftl");
        String chat = Chatglm2.chat(questionContent);
        System.out.println(chat);
    }

    @Test
    public void test2(){
        Map<String,Object> map = new HashMap<>();
        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH+"/ifelse1-1.ftl");
        String chat = Chatglm2.chat(questionContent);
        System.out.println(chat);
    }



    @Test
    public void test3(){
        Map<String,Object> map = new HashMap<>();
        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH+"/ifelse2.ftl");
        String chat = Chatglm2.chat(questionContent);
        System.out.println(chat);
    }

    @Test
    public void test4(){
        Map<String,Object> map = new HashMap<>();
        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH+"/ifelse2-1.ftl");
        String chat = Chatglm2.chat(questionContent);
        System.out.println(chat);
    }

    @Test
    public void test5(){
        Map<String,Object> map = new HashMap<>();
        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH+"/ifelse3.ftl");
        String chat = Chatglm2.chat(questionContent);
        System.out.println(chat);
    }


    @Test
    public void test6(){
        Map<String,Object> map = new HashMap<>();
        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH+"/ifelse4.ftl");
        String chat = Chatglm2.chat(questionContent);
        System.out.println(chat);
    }

    @Test
    public void test7(){
        Map<String,Object> map = new HashMap<>();
        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH+"/ifelse4-1.ftl");
        String chat = Chatglm2.chat(questionContent);
        System.out.println(chat);
    }


    @Test
    public void test8(){
        Map<String,Object> map = new HashMap<>();
        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH+"/ifelse4-2.ftl");
        String chat = Chatglm2.chat(questionContent);
        System.out.println(chat);
    }

    @Test
    public void test9(){
        Map<String,Object> map = new HashMap<>();
        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH+"/ifelse4-3.ftl");
        String chat = Chatglm2.chat(questionContent);
        System.out.println(chat);
    }


}
